/*
  ==============================================================================

  This is an automatically generated file created by the Jucer!

  Creation date:  5 Oct 2009 1:39:31 pm

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Jucer version: 1.12

  ------------------------------------------------------------------------------

  The Jucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-6 by Raw Material Software ltd.

  ==============================================================================
*/

#ifndef __JUCER_HEADER_EDOTOOLBAR_EDOTOOLBAR_64486282__
#define __JUCER_HEADER_EDOTOOLBAR_EDOTOOLBAR_64486282__

//[Headers]     -- You can add your own extra header files here --
#include "Includes.h"

#define EDO_TOOLBAR_PREFERENCES		-1
#define EDO_TOOLBAR_QUIT			-2
#define EDO_TOOLBAR_HELP			-3

class EdoToolbarListener
{
	public:
		virtual void toolbarEvent (const int eventId, Button *const triggerButton)=0;
};

class EdoToolbarSort
{
	public:
		int compareElements (ImageButton *first, ImageButton *second);
};
//[/Headers]



//==============================================================================
/**
                                                                    //[Comments]
    An auto-generated component, created by the Jucer.

    Describe your class and how it works here!
                                                                    //[/Comments]
*/
class EdoToolbar  : public Component,
                    public ButtonListener
{
public:
    //==============================================================================
    EdoToolbar ();
    ~EdoToolbar();

    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
	enum ToolbarIcons
	{
		PreferencesIcons,
		QuitIcon,
		DeleteIcon,
		AddIcon,
		FindIcon,
		SaveIcon,
		RefreshIcon,
		OpenIcon,
		NewIcon,
		SpaceInvaderIcon,
		GaduIcon,
		FolderIcon,
		EditCutIcon,
		EditCopyIcon,
		EditPasteIcon,
		EditSelectAllIcon,
		PersonIcon
	};

	const bool addToolbarListener (EdoToolbarListener *listenerToAdd);
	const bool removeToolbarListener (EdoToolbarListener *listenerToRemove);
	void broadcastEvent (const int eventToBroadcast, Button *const triggerButton=0);
	ImageButton *addItem (const uint32 itemId, const String &itemName, Image *icon);
	ImageButton *addItem (const uint32 itemId, const String &itemName, const ToolbarIcons internalIconId);
	void removeItem (const uint32 itemId);
	const bool itemExists(const uint32 itemId);
	void positionItems();
	void notify (const String &shortText, const Colour &textColour, const uint32 timeout=3500);
	ImageButton *getQuitButton();
	ImageButton *getPreferencesButton();
    //[/UserMethods]

    void paint (Graphics& g);
    void resized();
    void buttonClicked (Button* buttonThatWasClicked);

    // Binary resources:
    static const char* toolbar1_png;
    static const int toolbar1_pngSize;
    static const char* stock_preferences_png;
    static const int stock_preferences_pngSize;
    static const char* stock_quit2_png;
    static const int stock_quit2_pngSize;
    static const char* stock_delete_png;
    static const int stock_delete_pngSize;
    static const char* stock_add_png;
    static const int stock_add_pngSize;
    static const char* stock_find_png;
    static const int stock_find_pngSize;
    static const char* stock_save_png;
    static const int stock_save_pngSize;
    static const char* stock_refresh_png;
    static const int stock_refresh_pngSize;
    static const char* stock_open_png;
    static const int stock_open_pngSize;
    static const char* stock_new_png;
    static const int stock_new_pngSize;
    static const char* stock_person_png;
    static const int stock_person_pngSize;
    static const char* stock_invader_png;
    static const int stock_invader_pngSize;
    static const char* stock_gadu_png;
    static const int stock_gadu_pngSize;

    //==============================================================================
    juce_UseDebuggingNewOperator

private:
    //[UserVariables]   -- You can add your own custom variables in this section.
	Image *bgBrush;
	EdoToolbarListener *listener;
	OwnedArray <ImageButton> items;
	EdoToolbarSort itemSorter;
    //[/UserVariables]

    //==============================================================================
    ImageButton* preferencesButton;
    ImageButton* quitButton;
    Label* notificationLabel;

    //==============================================================================
    // (prevent copy constructor and operator= being generated..)
    EdoToolbar (const EdoToolbar&);
    const EdoToolbar& operator= (const EdoToolbar&);
};


#endif   // __JUCER_HEADER_EDOTOOLBAR_EDOTOOLBAR_64486282__
